Optimal. Leaf size=71 \[ \frac{2 \left (a^2+b^2\right ) \sin (c+d x)}{3 d}+\frac{\sin (c+d x) (a+b \cos (c+d x))^2}{3 d}+\frac{a b \sin (c+d x) \cos (c+d x)}{3 d}+a b x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0498053, antiderivative size = 71, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {2753, 2734} \[ \frac{2 \left (a^2+b^2\right ) \sin (c+d x)}{3 d}+\frac{\sin (c+d x) (a+b \cos (c+d x))^2}{3 d}+\frac{a b \sin (c+d x) \cos (c+d x)}{3 d}+a b x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2753
Rule 2734
Rubi steps
\begin{align*} \int \cos (c+d x) (a+b \cos (c+d x))^2 \, dx &=\frac{(a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}+\frac{1}{3} \int (2 b+2 a \cos (c+d x)) (a+b \cos (c+d x)) \, dx\\ &=a b x+\frac{2 \left (a^2+b^2\right ) \sin (c+d x)}{3 d}+\frac{a b \cos (c+d x) \sin (c+d x)}{3 d}+\frac{(a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.153382, size = 59, normalized size = 0.83 \[ \frac{3 \left (4 a^2+3 b^2\right ) \sin (c+d x)+b (12 a (c+d x)+6 a \sin (2 (c+d x))+b \sin (3 (c+d x)))}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.033, size = 63, normalized size = 0.9 \begin{align*}{\frac{1}{d} \left ({\frac{{b}^{2} \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}}+2\,ab \left ( 1/2\,\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) +1/2\,dx+c/2 \right ) +{a}^{2}\sin \left ( dx+c \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.966371, size = 81, normalized size = 1.14 \begin{align*} \frac{3 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a b - 2 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} b^{2} + 6 \, a^{2} \sin \left (d x + c\right )}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.8673, size = 124, normalized size = 1.75 \begin{align*} \frac{3 \, a b d x +{\left (b^{2} \cos \left (d x + c\right )^{2} + 3 \, a b \cos \left (d x + c\right ) + 3 \, a^{2} + 2 \, b^{2}\right )} \sin \left (d x + c\right )}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.611332, size = 107, normalized size = 1.51 \begin{align*} \begin{cases} \frac{a^{2} \sin{\left (c + d x \right )}}{d} + a b x \sin ^{2}{\left (c + d x \right )} + a b x \cos ^{2}{\left (c + d x \right )} + \frac{a b \sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{d} + \frac{2 b^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac{b^{2} \sin{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (a + b \cos{\left (c \right )}\right )^{2} \cos{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.39079, size = 81, normalized size = 1.14 \begin{align*} a b x + \frac{b^{2} \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac{a b \sin \left (2 \, d x + 2 \, c\right )}{2 \, d} + \frac{{\left (4 \, a^{2} + 3 \, b^{2}\right )} \sin \left (d x + c\right )}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]